# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=snmp-fuzzer
pkgver=0.1.1
pkgrel=10
groups=('blackarch' 'blackarch-fuzzer' 'blackarch-networking')
pkgdesc='SNMP fuzzer uses Protos test cases with an entirely new engine written in Perl.'
arch=('any')
url='http://www.arhont.com/en/category/resources/tools-utilities/'
license=('custom')
depends=('perl')
source=("https://dl.packetstormsecurity.net/UNIX/misc/$pkgname-$pkgver.tar.bz2")
sha512sums=('9527ab9ffd38e7f7fc0b1bb0695b436eb4e920692b4fd75b035dbde1a8e25a70c8da0295cac8f367a0563f62f2edc3c7080fb03784a1b4958b25e1c68042247e')

package() {
  cd "$pkgname-$pkgver"

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README
  install -Dm 644 LICENSE.TXT "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  cp -a *	"$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname/
exec perl snmpfuzz.pl "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

